Skip to content

fix: strengthen pr-reviewer cross-file context prompt#16

Merged
khaliqgant merged 1 commit into
mainfrom
fix/pr-reviewer-cross-file-context
May 29, 2026
Merged

fix: strengthen pr-reviewer cross-file context prompt#16
khaliqgant merged 1 commit into
mainfrom
fix/pr-reviewer-cross-file-context

Conversation

@khaliqgant

@khaliqgant khaliqgant commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Strengthens the pr-reviewer harness prompt to explicitly use the checked-out repo to trace the impact of the current diff across callers, types, tests, config, and related files.
  • Keeps scope bounded to breakage caused by this PR diff, not a general full-repo audit.

Assessment

  • Cloud runs the harness with cwd: ctx.sandbox.cwd, and the PR workspace setup creates a real git checkout at that cwd.
  • The checkout path fetches refs/pull/<number>/head, checks out pr-head, and guards that the worktree remains a git repo.
  • .workforce/pr.diff is generated as a three-dot binary diff from MERGE_BASE...pr-head; for very large diffs cloud caps it at PR_DIFF_MAX_BYTES and appends a truncation notice, so whole-repo context remains important for truncated diffs too.
  • The previous prompt allowed context reads but did not explicitly require tracing outside-diff callers/types/tests/configs, which was weak for signature/API-impact review.

Deployment note

This prompt change requires redeploying the pr-reviewer persona to take effect. This PR does not deploy it.

Verification

  • npm run typecheck
  • npm run compile attempted, but the repo script currently fails because the installed agentworkforce CLI does not provide the scripted persona subcommand (Unknown subcommand "persona").

Summary by cubic

Strengthens the pr-reviewer prompt to trace cross-file impact using the checked-out repo. It can now flag and fix breakage in callers, types, tests, and config outside the changed-file list, while staying scoped to this PR (not a full-repo audit).

Written for commit 9d76ed2. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c5cc1f43-cd3b-4a6f-83ca-212d1d5030c9

📥 Commits

Reviewing files that changed from the base of the PR and between c155a5b and 9d76ed2.

📒 Files selected for processing (1)
  • review/agent.ts

📝 Walkthrough

Walkthrough

The reviewAndFix harness prompt in review/agent.ts is updated to explicitly instruct the agent to trace the PR diff's impact across callers, types, tests, config, and related files. The previous generic guidance about using checkout for surrounding context is replaced with this more specific impact-tracing directive.

Changes

Harness Prompt Impact Tracing

Layer / File(s) Summary
Trace-impact instruction update
review/agent.ts
The reviewAndFix harness prompt is refined to guide the agent to trace the diff's impact across callers, types, tests, config, and related files, replacing the prior generic checkout context instruction.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • AgentWorkforce/agents#14: Both PRs modify the reviewAndFix harness prompt instructions in review/agent.ts to refine agent guidance.

Poem

A prompt refined, with sharper sight, 🔍
The agent now traces impact's flight—
Across the callers, types, and tests so bright,
Each change now seen in fuller light. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix: strengthen pr-reviewer cross-file context prompt' accurately describes the main change: strengthening a prompt to improve cross-file context analysis in the pr-reviewer.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about why the prompt was modified and how it impacts the pr-reviewer's ability to trace cross-file impacts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr-reviewer-cross-file-context

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the review agent's prompt in review/agent.ts to instruct it to trace the impact of code changes across callers, types, tests, and configurations, and to fix breakages even in files outside the changed-file set without performing an unrelated full-repo audit. There are no review comments, so no feedback is provided.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@khaliqgant khaliqgant merged commit 41d329d into main May 29, 2026
2 checks passed
@khaliqgant khaliqgant deleted the fix/pr-reviewer-cross-file-context branch May 29, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant